import React, { Component } from 'react'

const DetailData = [
    { id: '001', content: '我爱你，中国' },
    { id: '002', content: '我爱你，世界' },
    { id: '003', content: '我爱你，宇宙' }
]
export default class Detail extends Component {
    render() {
        // 接收参数
        const { id, title } = this.props.match.params
        const detailResult = DetailData.find((detailObj) => {
            return detailObj.id === id
        })
        return (
            <ul>
                <li>ID:{id}</li>
                <li>TITLE:{title}</li>
                <li>CONTENT:{detailResult.content}</li>
            </ul>
        )
    }
}
